home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / network / duftp.lzh / DUFTP / EXTRAS / SLIP.DIP < prev   
Encoding:
Text File  |  1995-06-07  |  2.4 KB  |  107 lines

  1. #
  2. # Annex terminal login script.
  3. #
  4. # Author:   Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  5. # Modified:    Craig Graham, <craig.graham@newcastle.ac.uk>
  6. #
  7.  
  8. main:
  9.   print DIP Script for Newcastle University.
  10.   print (w)Craig Graham,30/1/95.
  11.  
  12. # First of all, set up our name for this connection.
  13. # I am called "falcon.newcastle.ac.uk"
  14.   get $local falcon.newcastle.ac.uk
  15.  
  16. # Next, set up the other side's name and address.
  17. # My dialin machine is called 'knott.newcastle.ac.uk' (== 128.240.2.11)
  18.   get $remote knott
  19.  
  20. # Set netmask on sl0 to 255.255.255.0
  21.   netmask 255.255.255.0
  22.  
  23. # Set the desired serial port and speed.
  24. #  I've got a real slow modem :(
  25.   port ttyb
  26.   speed 2400
  27.  
  28. # Reset the modem and terminal line.
  29. # This seems to cause trouble for some people!
  30.   reset
  31.  
  32. # Prepare for dialing.
  33.   send ATQ0V1E1X4\r
  34.   wait OK 2
  35.   if $errlvl != 0 goto modem_trouble
  36.   print Dialing...
  37.   dial 2226455
  38.   if $errlvl != 0 goto modem_trouble
  39.   wait CONNECT 30
  40.   if $errlvl != 0 goto no_connect
  41.   print ...connected.
  42.  
  43. # We are connected.  Login to the system.
  44. login:
  45.   sleep 2
  46.   wait knott: 20
  47.   print Requesting a CSLIP connection...
  48.   send slip\n
  49.   wait Username: 20
  50.   if $errlvl != 0 goto login_error
  51. #replace myname with your name here
  52.   send myname\n
  53.   wait Password: 20
  54.   if $errlvl != 0 goto password_error
  55. #replace mypassword with your password here
  56.   send mypassword\n
  57. loggedin:
  58.  
  59. # Set the remote IP address (this may have already been done,
  60. #  but just to be sure). replace this with the IP address of your
  61. #  annex.
  62.   get $rmtip 128.240.2.11
  63.  
  64. # Get the allocated local IP address from the Annex.
  65.   wait Your 20
  66.   wait is 15
  67.   get $locip remote
  68.  
  69.   if $errlvl != 0 goto prompt_error
  70.  
  71. # Set up the SLIP operating parameters.
  72.   get $mtu 296
  73.  
  74. # Ensure "route add -net default knott.newcastle.ac.uk" will be done
  75.   default
  76.  
  77. # Say hello and switch to SLIP mode.
  78. done:
  79.   print CONNECTED $locip ---> $rmtip
  80.   mode CSLIP
  81.   goto exit
  82.  
  83. prompt_error:
  84.   print TIME-OUT waiting for SLIPlogin to fire up...
  85.   goto error
  86.  
  87. login_trouble:
  88.   print Trouble waiting for the Login: prompt...
  89.   goto error
  90.  
  91. password:error:
  92.   print Trouble waiting for the Password: prompt...
  93.   goto error
  94.  
  95. no_connect:
  96.   print Cann't connect to remote host...
  97.   goto error
  98.  
  99. modem_trouble:
  100.   print Trouble ocurred with the modem...
  101. error:
  102.   print CONNECT FAILED to $remote
  103.   quit
  104.  
  105. exit:
  106.   exit
  107.